package com.hi.zack.demo.rmi;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 * @Author Zack
 * @Since 2021/12/14 22:17
 */
public class RMIInvoker {

    public void invoke(String url) {
        try {
            Context context = new InitialContext();
            Object object = context.lookup(url);
            System.out.println("RMI result: " + object);

        } catch (NamingException e) {
            e.printStackTrace();
        }
    }
}
